package com.young.test.aop;

import org.apache.log4j.Logger;

import javax.inject.Named;

import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;

import com.young.test.customannotation.Brand;

@Named
@Aspect
public class AnnotationAdvice {
	/**
	 * Logger for this class
	 */
	private static final Logger logger = Logger.getLogger(AnnotationAdvice.class);

	@Before("com.young.test.aop.SystemArchitecture.forAnnotationByBrandMethod(brand)")
	public void annotationMethodAdvice(Brand brand){
		logger.info("--- this is annotation by method ---");
		logger.info("Brand value is :"+brand.value());
	}
	
	@Before("com.young.test.aop.SystemArchitecture.forAnnotationByBrandType(brand)")
	public void annotationTypeAdvice(Brand brand){
		logger.info("--- this is annotation by Type ---");
		logger.info("Brand value is :"+brand.value());
	}
}
